package cn.getech.data.development.model.res.realtimeresource;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang.StringUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * 实时资源管理
 * 
 * @author qiuxinglei
 * @email qiuxinglei@gmail.com
 * @date 2020-09-02 11:14:22
 */
@ApiModel(description = "实时资源管理")
public class RealtimeResourceListRes implements Serializable {
	private static final long serialVersionUID = 1L;

	@Getter
	@Setter
	@ApiModelProperty(value = "")
	private Long resourceId;

	@Getter
	@Setter
	@ApiModelProperty(value = "资源名称")
	private String resourceName;

	@Getter
	@Setter
	@ApiModelProperty(value = "资源文件 全路径")
	private String resourceFilename;

	@Getter
	@Setter
	@ApiModelProperty(value = "文件类型 1:jar 2:py 3:txt 4:sh 5:excel")
	private Integer resourceType;

	@Getter
	@Setter
	@ApiModelProperty(value = "描述")
	private String resourceDesc;

	@Getter
	@Setter
	@ApiModelProperty(value = "创建时间")
	private Date createTime;

	@Getter
	@Setter
	@ApiModelProperty(value = "创建人")
	private String username;

	@Getter
	@Setter
	@ApiModelProperty(value = "资源类型 1:实时 2:离线 3:公共")
	private Integer typeResource;

	@ApiModelProperty(value = "资源文件")
	private String resourceFilename2;


	public String getResourceFilename2() {
		if(StringUtils.isNotEmpty(resourceFilename)){
			return resourceFilename.substring(resourceFilename.indexOf("/")+1);
		}
		return null;
	}

}
